package com.xyy.saas.payment.adpater.xydLoan.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * @author wangzeqi
 */
@Getter
@AllArgsConstructor
public enum XydNotifyRepaymentOptStatus {

    /**
     * 成功
     */
    SUCCESS("1"),

    /**
     * 失败
     */
    FAIL("0"),
    ;

    private final String code;


    public static XydNotifyRepaymentOptStatus fromCode(String code) {
        return Arrays.stream(XydNotifyRepaymentOptStatus.values())
                .filter(s -> Objects.equals(s.getCode(), code))
                .findFirst()
                .orElse(null);
    }

}
